<?php
/**
 * CreateUser: zlh
 * CreateTime: 2022/1/19 18:49
 * Remark:该类主要用来处理审批模板模型
 */

namespace App\Models\DingTalk;

use App\Consts\TableConsts\TableConsts;
use App\Models\BaseModel;
use Illuminate\Support\Facades\DB;

class DingTalkApprovalProcessModel extends BaseModel
{
    protected $table = TableConsts::CY_DING_TALK_APPROVAL_TEMPLATE_TABLE_NAME;

    protected $primaryKey = TableConsts::CY_DING_TALK_APPROVAL_TEMPLATE_TABLE_PRIMARY_KEY;

    public static function getTemplateCodeByTemplateId(int $templateId){
        DB::enableQueryLog();
        self::select(['ding_talk__approval_template_code','ding_talk__approval_template_name'])->where('ding_talk_approval_template_id',$templateId)->first();
        return response()->json(DB::getQueryLog());
    }
}